package org.hydrakyoufeng.stuplatform.generator;

import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.stereotype.Component;

import java.lang.reflect.Method;

@Component
public class CourseKeyGenerator implements KeyGenerator {
    @Override
    public Object generate(Object o, Method method, Object... objects) {
        StringBuilder stringBuilder = new StringBuilder("course:list:");
        for (Object obj: objects) {
            stringBuilder.append(obj);
        }
        System.out.println("key:" + stringBuilder.toString());
        return stringBuilder.toString();
    }
}
